#ifndef     __PARTS_H
#define     __PARTS_H

#include <stdint.h>
#include "../utils/nocopyable.h"
#include "../utils/object.h"

namespace driver {

class Parts : private utils::NoCopyable {

public:
    Parts();

    void heat_close();
    void steam_heat_close();
    void steam_heat_open();
    void water_heat_close();
    void water_heat_open();
    
    void valve_open(uint8_t id);
    void valve_close(uint8_t id);

    void steam_pump_open();
    void steam_pump_close();

    void water_pump_open();
    void water_pump_close();

    void outlet_pump_open();
    void outlet_pump_close();

    uint16_t status() const {
        return (m_steam_heat_flag) +
            (m_water_heat_flag << 1) +
            (m_steam_pump_flag << 2) +
            (m_water_pump_flag << 3) +
            (m_valve1_flag << 4) +
            (m_valve2_flag << 5) +
            (m_valve3_flag << 6) +
            (m_valve4_flag << 7) +
            (m_outlet_pump_flag << 8)
            ;
    }

private:
    bool m_steam_heat_flag = false;
    bool m_water_heat_flag = false;

    bool m_steam_pump_flag = false;
    bool m_water_pump_flag = false;

    bool m_valve1_flag = false;
    bool m_valve2_flag = false;
    bool m_valve3_flag = false;
    bool m_valve4_flag = false;

    bool m_outlet_pump_flag = false;
};

inline utils::Object<Parts> parts;

}


#endif
